package com.open.capacity.prints.service.impl;

import com.open.capacity.prints.util.uuid.UUIDUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

import com.open.capacity.prints.entity.FileInfo;
import com.open.capacity.prints.dao.FileInfoDao;
import com.open.capacity.prints.service.FileInfoService;


@Service
public class FileInfoServiceImpl implements FileInfoService {

    @Autowired
    private FileInfoDao fileInfoDao;

    /**
     * 添加
     *
     * @param fileInfo
     */
    public int save(FileInfo fileInfo) {
        fileInfo.setId(UUIDUtils.getOriginalUUIDWithoutBar());
        fileInfo.setCreateTime(new Date());
        return fileInfoDao.save(fileInfo);
    }


    /**
     * 删除
     *
     * @param id
     */
    public int delete(String id) {
        return fileInfoDao.delete(id);
    }

    @Override
    public int deleteByIds(List<String> ids) {
        return fileInfoDao.deleteByIds(ids);
    }

    /**
     * 查询记录
     *
     * @param id
     * @return
     */
    public FileInfo findById(String id) {
        return fileInfoDao.findById(id);
    }

    @Override
    public List<FileInfo> findByIds(List<String> ids) {
        return fileInfoDao.findByIds(ids);
    }


}
